<html>

<head>
    <title>grapecity_spreadJS_demo</title>
    <script src="jquery_3.1.1.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="gc.spread.sheets.excel2013white.14.2.2.css" type="text/css">
    <script src="gc.spread.sheets.all.14.2.2.min.js" type="text/javascript"></script>
    <script src="gc.spread.excelio.14.2.2.min.js" type="text/javascript"></script>
    <script src="https://cdn.grapecity.com.cn/spreadjs/scripts/FileSaver.min.js" type="text/javascript"></script>
    <script src="gc.spread.sheets.resources.zh.14.2.2.min.js" type="text/javascript"></script>
    <script src="gc.spread.sheets.print.14.2.2.min.js" type="text/javascript"></script>
    <script src="gc.spread.sheets.pdf.14.2.2.min.js" type="text/javascript"></script>
    <script src="gc.spread.sheets.charts.14.2.2.min.js" type="text/javascript"></script>
    <script src="v14.js" type="text/javascript"></script>
    <style type="text/css">
        p{
            color: #336699;
            text-align: center;
        }
        
        #ss{
            width: 100%;
            height: 450px;
        }
    </style>
</head>

<body>
    <p>滚动表单添加行</p>
    <div id="ss"></div>
    <script type="text/javascript">
        //Title: 无限行
        //Description：表单行数滚动自增加
        //Tag：无限行
        
        GC.Spread.Common.CultureManager.culture('zh-cn');
        $(document).ready(function() {
            var spread = new GC.Spread.Sheets.Workbook(document.getElementById('ss'), {
                sheetCount: 1
            });
        
        
            spread.options.scrollbarMaxAlign = true;
            spread.options.scrollbarShowMax = true;
            var sheet1 = spread.getActiveSheet();
            sheet1.bind(GC.Spread.Sheets.Events.TopRowChanged, function(sender, args) {
                var rowCount = sheet1.getRowCount();
                var bottomRow = sheet1.getViewportBottomRow(1);
                if (bottomRow == rowCount - 1) {
                    if (rowCount < 10000) {
                        sheet1.setRowCount(rowCount + 10);
                    }
                }
            });
        });
    </script>
</body>

</html>